<form id="add-forms" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div style="font-size: 20px;text-align: center;">
        <span >同价调拨单</span>
    </div>
    <div class="content">
        <div class="panel panel-default panel-intro">

            <div class="panel-body">
                <div id="myTabContent" class="tab-content">
                    <div class="tab-pane fade active in" id="one">
                        <div class="widget-body no-padding">

                            <div class="bootstrap-table">
                                <div class="commonsearch-table ">
                                    <fieldset>
                                        <div class="row">
                                            <div class="" style="float: left;width:25%">
                                                <label  style="float: left" for="operator" >&nbsp;&nbsp;&nbsp;&nbsp;入库仓库 : </label>
                                                <div class="" style="float: left">
                                                    <span class="">{$hrow.name}</span>
                                                </div>
                                            </div>
                                            <div class="" style="float: left;width:25%">
                                                <label  style="float: left" for="operator" >&nbsp;&nbsp;&nbsp;&nbsp;出库仓库 : </label>
                                                <div class="" style="float: left">
                                                    <span class="">{$source_row.name}</span>
                                                </div>
                                            </div>
                                            <div class="" style="float: left;width:25%">
                                                <label  style="float: left" for="operator" >&nbsp;&nbsp;&nbsp;&nbsp;说明 : </label>
                                                <div class="" style="float: left">
                                                    <span class="">{$row.explain}</span>
                                                </div>
                                            </div>
                                        </div>
                                    </fieldset>
                                </div>
                            </div>
                                <table id="table" class="table table-striped table-bordered table-hover table-nowrap"  data-operate-edit="1" data-operate-del="1" width="auto">
                                    <thead>
                                    <tr>
                                        <th style="text-align: center; vertical-align: middle; " data-field="id">
                                            <div class="th-inner ">Id</div>
                                            <div class="fht-cell">
                                            </div>
                                        </th>
                                        <th style="text-align: center; vertical-align: middle; " data-field="createtime">
                                            <div class="th-inner ">商品编号</div>
                                        </th>
                                        <th style="text-align: center; vertical-align: middle; " data-field="number"><div class="th-inner ">商品名称</div>
                                        </th>

                                        <th style="text-align: center; vertical-align: middle; " data-field="supplier_id">
                                            <div class="th-inner ">规格</div>
                                        </th>
                                        <th style="text-align: center; vertical-align: middle; " data-field="order_goods_total"><div class="th-inner ">申请数量</div><div class="fht-cell"></div></th>
                                        <th style="text-align: center; vertical-align: middle; " data-field="arrival_total"><div class="th-inner ">单位</div><div class="fht-cell"></div></th>
                                        <th style="text-align: center; vertical-align: middle; " data-field="operate"><div class="th-inner ">备注</div><div class="fht-cell"></div></th>
                                    </tr>
                                    </thead>
                                    <tbody data-listidx="0" class="connnn">
                                            {volist name="list" id="vo"}
                                                    <tr data-index="0">
                                                        <td style="text-align: center; vertical-align: middle; ">
                                                            {$vo.id}
                                                        </td>
                                                        <td style="text-align: center; vertical-align: middle; ">{$vo.number}</td>
                                                        <td style="text-align: center; vertical-align: middle; ">{$vo.title}</td>
                                                        <td style="text-align: center; vertical-align: middle; ">{$vo.specs}</td>
                                                        <td style="text-align: center; vertical-align: middle; " class="requisition_num" >{$vo.goods_num}</td>
                                                        <td style="text-align: center; vertical-align: middle; ">{$vo.unit}</td>
                                                        <td style="text-align: center; vertical-align: middle; ">{$vo.remark}</td>
                                                     </tr>
                                            {/volist}
                                    </tbody>

                                    <tbody class="tbfoot" data-listidx="0" >
                                        <td style="text-align: center; vertical-align: middle; ">合计</td>
                                        <td style="text-align: center; vertical-align: middle; "></td>
                                        <td style="text-align: center; vertical-align: middle; "></td>
                                        <td style="text-align: center; vertical-align: middle; "></td>
                                        <td style="text-align: center; vertical-align: middle; " class="allnum"></td>
                                        <td style="text-align: center; vertical-align: middle; " ></td>
                                        <td style="text-align: center; vertical-align: middle; " ></td>
                                    </tbody>
                                </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
<div class="form-group layer-footer">
<!--    <a class="btn btn-outline-success" href="javascript:printHTML('#add-forms')" target="_self" style="margin-left: 20px">打印</a>-->
        <a class="btn btn-outline-success  printing" href="###" target="_self" style="margin-left: 20px" >打印</a>
</div>
<script>
    $(function () {
        $('.printing').click(function () {
            printHTML('#add-forms')
        })
        function printHTML(page)
        {
            var bodyHTML=window.document.body.innerHTML;
            window.document.body.innerHTML=$(page).html();
            console.log(page)
            console.log($(page).html())
            // console.log($('#add-forms').html())
            window.print();
            window.document.body.innerHTML=bodyHTML;
        }
    })

</script>

<script>
    function count() {
        var anum = 0;//采购数量
        $('.connnn').find("tr").each(function(){
            tnum = $(this).find('.requisition_num').html()*1 //采购数量
            anum = anum*1 +tnum*1
        });
        $('.allnum').html(anum)
    }
    count()
</script>